<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "tba_loginfo".
 *
 * @property integer $ID
 * @property integer $TAu_ID
 * @property string $OperID
 * @property string $Url
 * @property string $Content
 * @property string $LogTime
 * @property string $IP
 *
 * @property TauOperinfo $tAu
 */
class TbaLoginfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tba_loginfo';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['TAu_ID'], 'integer'],
            [['Content', 'LogTime', 'IP'], 'required'],
            [['LogTime'], 'safe'],
            [['OperID'], 'string', 'max' => 6],
            [['Url'], 'string', 'max' => 200],
            [['Content'], 'string', 'max' => 2000],
            [['IP'], 'string', 'max' => 20]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'TAu_ID' => 'Tau  ID',
            'OperID' => 'Oper ID',
            'Url' => 'Url',
            'Content' => 'Content',
            'LogTime' => 'Log Time',
            'IP' => 'Ip',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTAu()
    {
        return $this->hasOne(TauOperinfo::className(), ['ID' => 'TAu_ID', 'OperID' => 'OperID']);
    }
}
